#region "TExpando"

/*
 * ####     Developer Name : Wang Yucai
 * 
 * ####     Development Tool : Microsoft VisualStudio 2010 Ultimate Edition
 * 
 * ####     Create Time : 2014/7/8 11:22:17
 * 
 * ####     Namespace : Masterduner.SourceStudio.Practices.DevelopmentLibrary
 * 
 * ####     Type Name : TExpando
 * 
 * ####     Full Name : Masterduner.SourceStudio.Practices.DevelopmentLibrary.TExpando
 * 
 * ####     Machine Name : GLCHQWYCWINW7
 * 
 * ####     UserName : GUOCOLAND/wangyucai
 * 
 * ####     CLR Version : 4.0.30319.18408
 * 
 * ####     Target Framework Version : 4.0
 */

#endregion

using System;

namespace Masterduner.SourceStudio.Practices.DevelopmentLibrary
{
    /// <summary>
    /// <para>Masterduner.SourceStudio.Practices.DevelopmentLibrary.TExpando</para>
    /// <para>
    /// 为泛型提供的辅助性方法。
    /// </para>
    /// </summary>
    /// <typeparam name="T">泛型T。</typeparam>
    /// <remarks>
    /// <para>Target Framework Version : 4.0</para>
    /// </remarks>
    public static class TExpando<T>
    {
        #region GetDefault
        /// <summary>
        /// 获取<typeparamref name="T"/>类型的默认值。
        /// </summary>
        /// <returns><typeparamref name="T"/>类型默认值。</returns>
        static public T GetDefault()
        {
            return default(T);
        }
        #endregion

        #region GetType
        /// <summary>
        /// 获取<typeparamref name="T"/>对应的<see cref="Type"/>对象实例。
        /// </summary>
        /// <returns><see cref="Type"/>对象实例。</returns>
        static public new Type GetType()
        {
            return typeof(T);
        }
        #endregion

        #region CreateInstance
        /// <summary>
        /// 创建<typeparamref name="T"/>类型的对象实例。
        /// </summary>
        /// <param name="arguments">调用<typeparamref name="T"/>类型的构造函数所需的参数。</param>
        /// <returns><typeparamref name="T"/>类型对象实例。</returns>
        static public T CreateInstance(params object[] arguments)
        {
            return Creator.CreateInstance(GetType(), arguments).ForceTo<T>();
        }
        #endregion
    }
}

#region README

/*
 * ####     ©2014 Wang Yucai
 * 
 * ####     Contact me
 *                  
 *                  E-mail : Masterduner@Yeah.net
 *                  Mobile : 13621384677
 *                  QQ : 180261899
 */

#endregion